package com.kk.observer.trational;

/**
 * @author o_o
 */
public class CurrentWeather {
    /**
     * 1.气温
     */
    private float temperature;
    /**
     * 2.气压
     */
    private float pressure;
    /**
     * 3.湿度
     */
    private float humidity;

    /**
     * 更新天气
     *
     * @param temperature
     * @param pressure
     * @param humidity
     */
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    /**
     * 输出天气
     */
    private void display() {
        System.out.printf("气温：%s, 气压：%s, 湿度：%s \n", temperature, pressure, humidity);
    }

}
